package cn.wolfcode.domain;

import com.alibaba.fastjson.JSON;
import lombok.Data;

import java.util.Date;
import java.util.HashMap;

@Data
public class CourseOrder {
    private Long id;//id
    private Date inputTime;//时间
    private Customer customer;//客户id
    private SystemDictionaryItem course;//课程id
    private Long money;//钱

    public String getJson(){
        HashMap<String, Object> map = new HashMap<>();
        map.put("id",id);
        map.put("inputTime",inputTime);
        map.put("money",money);

        if(customer != null){
            map.put("customer",customer.getId());
        }

        if(course != null){
            map.put("course",course.getId());
        }
        return JSON.toJSONString(map);
    }
}